package com.flying.planewar.utils;

import javax.imageio.ImageIO;
import java.awt.*;
import java.io.IOException;
import java.net.URL;

/**
 * @author 刘鹏飞
 * @Classname PlaneUtil
 * @Date 2024/12/17 14:19
 * @Created by 刘鹏飞
 * @Description
 */
public class PlaneUtil {
    public  static final int FRAME_WIDTH=500;
    public  static final int FRAME_HEIGHT=500;


    public static Image getImage(String url) {
        Image image = null;
        URL resource = PlaneUtil.class.getClassLoader().getResource(url);

        try {
            if (resource != null) {
                image = ImageIO.read(resource);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return image;

    }
}
